package com.peng.servlet;

import com.peng.entity.work;
import com.peng.service.impl.workServiceImpl;
import com.peng.service.workService;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * Created by 欧阳欣鹏 on 2018/8/14.
 */
public class FindbyIdWorkServlet extends HttpServlet {
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        request.setCharacterEncoding("utf-8");
        int a=Integer.parseInt(request.getParameter("a"));
        System.out.print(a);
        int id=Integer.parseInt(request.getParameter("id"));
        workService ws=new workServiceImpl();
        work w=ws.findbuId(id);
        request.setAttribute("w",w);
        request.setAttribute("a",a);
        request.getRequestDispatcher("admin-upd.jsp").forward(request,response);
    }

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
doPost(request,response);
    }
}
